import { _decorator, Animation, Component, Node } from 'cc';
import { Globals } from '../Globals';
const { ccclass, property } = _decorator;

// 溅射血液预制体
@ccclass('SplatterBlood')
export class SplatterBlood extends Component {

    protected onLoad(): void {
        this.node.getComponent(Animation).on(Animation.EventType.FINISHED, this.onFinisHed, this);
    }

    protected onDisable(): void {
        this.node.getComponent(Animation).off(Animation.EventType.FINISHED, this.onFinisHed, this);
    }

    start() {

    }

    update(deltaTime: number) {

    }

    // 动画播放完成，回收节点
    onFinisHed() {
        this.node.destroy();
    }
}


